﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Lokad.Monitoring.Persistence.Entities.Endpoint>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Monitored endpoints
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Monitored endpoints</h2>

    <table>
        <tr>
            <th></th>
            <th>
                Name
            </th>
            <th>
                Frequency
            </th>
            <th>
                Last Retrieved
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.ActionLink("Edit", "Edit", new { id=item.Id }) %> |
                <%= Html.ActionLink("Retrieve", "Retrieve", new { id=item.Id }) %> |
                <%= Html.ActionLink("Details", "Details", new { id=item.Id }) %> |
            </td>
            <td>
                <%= string.Format("<a href=\"{0}\">{1}</a>", 
                    Html.Encode(item.Url), Html.Encode(item.Id)) %>
            </td>
            <td>
                <%= Html.Encode(item.Frequency) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.LastRetrieved)) %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Create New", "Create") %>
    </p>

    <p>
        Deleting an endpoint: /Endpoint/Delete/<em>endpointName</em>
    </p>

</asp:Content>

